import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Films from '../views/Films'
import Article from '../views/Article'
import Music from '../views/Music'
import MusicMore from '../views/Music/More.vue'
import MusicDetail from '../views/Music/detail.vue'
import MusicPlay from '../views/Music/MusicPlay.vue'
import Search from '../views/Music/Search.vue'
import MovieDetail from '../views/Films/MovieDetail.vue'
import MovieSearch from '../views/Films/MovieSearch.vue'
import MovieAll from '../views/Films/MovieAll.vue'
import NowPlaying from '../views/Films/children/NowPlaying.vue'
import ComingSoon from '../views/Films/children/ComingSoon.vue'
import ArticleDetail from '../views/Article/ArticleDetail.vue'
import city from '../views/Music/component/city.vue'
Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect:"/home"
  },
  {
    path: '/home',
    name: 'Home',
    component:Home,
  },
  {
    path: '/films',
    name: 'Films',
    component: Films,
    meta:{
      isNav:true
    },
    children:[
      {
        path:"nowPlaying",
        component:NowPlaying,
        meta:{
          isNav:true
        }
      },
      {
        path:"ComingSoon",
        component:ComingSoon,
        meta:{
          isNav:true
        }

      }
    ]
  },
  {
    path: '/city',
    name: 'city',
    component:city,
  },
  {
    path: '/article',
    name: 'Article',
    component:Article,
    meta:{
      isNav:true
    },
    
  },
  {
    path: '/ArticleDetail/:id',
    name: 'ArticleDetail',
    component:ArticleDetail, 
  },
  {
    path: '/music',
    name: 'Music',
    component:Music,
    meta:{
      isNav:true
    }
  },
  {
    path: '/musicMore/:title',
    name: 'MusicMore',
    component:MusicMore,
    
  },
  {
    path: '/MusicDetail/:id',
    name: 'MusicDetail',
    component:MusicDetail,
    
  },
  {
    path: '/MusicPlay/:id',
    name: 'MusicPlay',
    component:MusicPlay,
    
  },
  {
    path: '/search',
    name: 'Search',
    component: Search,
  },
  {
    path: '/movieDetail',
    name: 'MovieDetail',
    component:MovieDetail,
  },
  {
    path: '/movieSearch',
    name: 'MovieSearch',
    component: MovieSearch,
  },
  {
    path: '/movieAll',
    name: 'MovieAll',
    component:MovieAll,
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
